<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<title>ERP进销存管理系统</title>
		<link href="main.css" rel="stylesheet" type="text/css"/>
		<script>
		 function check(){
		    if (confirm("您确定要修改吗？")){
              if (document.getElementById("name").value==""){
                  alert("用户名不能为空！");
                  return false;
              }
              if (document.getElementById("password").value==""){
                  alert("密码不能为空！");
                  return false;
              }                          
              if (document.getElementById("password").value!=document.getElementById("confirmpassword").value){
                  alert("密码前后输入不一致！");
                  return false;
              }
		    }
		 }
		</script>
	</head>
	<body>
	    <form action="power!change.do" method="post" name="form">
		<table class="tableborder" cellspacing=1 cellpadding=4 width="99%" align="center">
			<tr>
				<td colspan="4" class="header">用户信息修改<input type="hidden" name="uid" value="<s:property value="employee.id"/>"/></td>
			</tr>
			<colgroup align=left>
				<col class="altbg1" width="20%"/>							
				<col class="altbg2" width="30%"/>
				<col class="altbg1" width="20%"/>
				<col class="altbg2" width="30%"/>
			</colgroup>
			<tr>
				<td>&nbsp;用户ID：</td>
				<td>&nbsp;<s:property value="employee.employeeid" /></td>
				<td>&nbsp;用户姓名：</td>
				<td>&nbsp;<input type="text" id="name" name="employee.name" value="<s:property value="employee.name"/>"/></td>
			</tr>
			<tr>
				<td>&nbsp;用户角色</td>
				<td><select name="roleid">
						<option value="1" <s:if test="${employee.role.id}==1">selected</s:if>>系统管理员</option>
						<option value="2" <s:if test="${employee.role.id}==2">selected</s:if>>采购人员</option>
						<option value="3" <s:if test="${employee.role.id}==3">selected</s:if>>采购主管</option>
						<option value="4" <s:if test="${employee.role.id}==4">selected</s:if>>总经理</option>
						<option value="5" <s:if test="${employee.role.id}==5">selected</s:if>>元器件库管员</option>
						<option value="6" <s:if test="${employee.role.id}==6">selected</s:if>>成品库管理员</option>
						<option value="7" <s:if test="${employee.role.id}==7">selected</s:if>>销售主管</option>
						<option value="8" <s:if test="${employee.role.id}==8">selected</s:if>>销售人员</option>
					</select>
				</td>
				<td>&nbsp;启用：</td>
				<td>
				<select name="employee.enabled">
					<option value="1" <s:if test="${employee.enabled}==1">selected</s:if>>启用</option>
					<option value="0" <s:if test="${employee.enabled}==0">selected</s:if>>停用</option>
				</select>
				</td>
			</tr>
			<tr>
				<td>&nbsp;新密码</td>
				<td><input type="password" size="22" id="password" name="employee.password" value="<s:property value="employee.password"/>"/></td>
				<td>&nbsp;重复新密码</td>
				<td><input type="password" size="22" id="confirmpassword" name="confirmpassword"  value="<s:property value="employee.password"/>"/></td>
			</tr>
		   <tr>
			   <td colspan="4" bgcolor="d6eoef" align="center">
					<input type="submit" value="提交" onclick="return check();"/>
			   </td>
		   </tr>
		</table>
		</form>
	</body>
</html>